package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("fos.txt",true);

        fos.write("火在烧，烧成灰有多好。".getBytes(StandardCharsets.UTF_8));
        fos.write("叫思念，不要吵".getBytes(StandardCharsets.UTF_8));



        /*FileInputStream fis = new FileInputStream("fos.txt");
        String line = "白月光在照耀，你才想起他的好。";
        byte[] data = line.getBytes(StandardCharsets.UTF_8);
        fos.write(data);

        line = "朱砂痣久难消，你是否能知道。";
        fos.write(line.getBytes(StandardCharsets.UTF_8));*/
        System.out.println("写出完毕");
        fos.close();
    }
}
